home *** CD-ROM | disk | FTP | other *** search
- on initit
- global smash
- if objectp(smash) then
- smash(mdispose)
- end if
- set smash to SmashFact(mnew)
- end
-
- factory SmashFact
- method mnew
- instance damageTot, SmashTot, WtBtnSpr, BallBtnSpr, stars, WeightSpr, ballSpr, ItemSpr1, itemspr2, ItemSpr3, itemSpr4, WeightArt, BallArt, itemart1, itemArt2, itemArt3, itemArt4, itemValue1, itemValue2, itemValue3, itemValue4, itemCntr1, itemCntr2, itemCntr3, ItemCntr4, ItemSnd1, ItemSnd2, ItemSnd3, ItemSnd4, ClokArt1, clokArtSmsh, DogArt1, DogArt2, VaseArt1, VaseArt2, bowlart1, BowlArt2, DogArt3, DogArt4, VaseArt3, VaseArt4, BowlArt3, BowlArt4, WineArt1, WineArt2, WineArt3, WineArt4, WtDropArt1, WtDropArt2, WtDropArt3, WtDropArt4, WtDropArt5, WtDropArt6, WtDropArt7, WtDropArt8, WtDropArt9, WtHRest, WtVRest, weightDo, BallDo, ItemDo1, ItemDo2, itemdo3, ItemDo4, BreakDo3, WeightH, BallH, ItemH1, ItemH2, ItemH3, ItemH4, WeightV, BallV, ItemV1, ItemV2, ItemV3, ItemV4, wtcntr, mastercntr, tempcntr, clokCntr, droppd, LaunchH1, LaunchV1, LaunchH2, LaunchV2, PixMovH, PixMovV, HandArt1, HandArt2, HandArt3, HandArt4, HandArt5
- set WtBtnSpr to 21
- set BallBtnSpr to 22
- set HandArt1 to the number of cast "Hand.1"
- set HandArt2 to HandArt1 + 1
- set HandArt3 to HandArt1 + 2
- set HandArt4 to HandArt1 + 3
- set HandArt5 to HandArt1 + 4
- set PixMovH to 14
- set PixMovV to 10
- set ClokArt1 to the number of cast "clok.1"
- set clokArtSmsh to the number of cast "clokArtSmsh.1"
- set WtDropArt1 to the number of cast "weight.1"
- set WtDropArt2 to the number of cast "weight.2"
- set WtDropArt3 to the number of cast "weight.3"
- set WtDropArt4 to the number of cast "weight.4"
- set WtDropArt5 to the number of cast "weight.5"
- set WtDropArt6 to the number of cast "weight.6"
- set WtDropArt7 to the number of cast "weight.7"
- set WtDropArt8 to the number of cast "weight.8"
- set WtDropArt9 to the number of cast "weight.9"
- set LaunchH1 to 531
- set LaunchV1 to 360
- set LaunchH2 to -18
- set LaunchV2 to 276
- set ballSpr to 6
- set WeightSpr to 7
- set ItemSpr1 to 8
- set itemspr2 to 9
- set ItemSpr3 to 10
- set itemSpr4 to 11
- set WtHRest to the locH of sprite WeightSpr
- set WtVRest to the locV of sprite WeightSpr
- set WeightH to WtHRest
- set WeightV to WtVRest
- set DogArt1 to the number of cast "HotDog.1"
- set DogArt2 to the number of cast "HotDog.2"
- set VaseArt1 to the number of cast "Vase.1"
- set VaseArt2 to the number of cast "Vase.2"
- set bowlart1 to the number of cast "Bowl.1"
- set BowlArt2 to the number of cast "Bowl.2"
- set WineArt1 to the number of cast "Wine.1"
- set WineArt2 to the number of cast "Wine.2"
- set DogArt3 to the number of cast "HotDog.3"
- set DogArt4 to the number of cast "HotDog.4"
- set VaseArt3 to the number of cast "Vase.3"
- set VaseArt4 to the number of cast "Vase.4"
- set BowlArt3 to the number of cast "Bowl.3"
- set BowlArt4 to the number of cast "Bowl.4"
- set WineArt3 to the number of cast "Wine.3"
- set WineArt4 to the number of cast "Wine.4"
- set WeightArt to the number of cast "weight.1"
- set BallArt to the number of cast "ball.1"
- set itemart1 to DogArt1
- set itemArt2 to DogArt1
- set itemArt3 to DogArt1
- set itemArt4 to DogArt1
- set weightDo to "nuttin"
- set BallDo to "nuttin"
- set ItemDo1 to "nuttin"
- set ItemDo2 to "nuttin"
- set itemdo3 to "nuttin"
- set ItemDo4 to "nuttin"
- set itemCntr1 to 0
- set itemCntr2 to 0
- set itemCntr3 to 0
- set ItemCntr4 to 0
- set mastercntr to 1000
- set tempcntr to 1000
- set clokCntr to 0
- set damageTot to 0
- set SmashTot to 0
-
- method award val
- set dmg to val
- set damageTot to damageTot + dmg
- put "$" & damageTot into field "dmgFLD"
- set SmashTot to SmashTot + 1
-
- method nuttin
- nothing()
-
- method begingame
- puppetSound("JSpcBtn13.AIF")
- updateStage()
- preLoadCast("ball.1", "WateHit.5")
- set weightDo to "nuttin"
- set BallDo to "nuttin"
- set ItemDo1 to "nuttin"
- set ItemDo2 to "nuttin"
- set itemdo3 to "nuttin"
- set ItemDo4 to "nuttin"
- set itemCntr1 to 0
- set itemCntr2 to 0
- set itemCntr3 to 0
- set ItemCntr4 to 0
- set mastercntr to 1000
- set tempcntr to 1000
- set clokCntr to 0
- set SmashTot to 0
- set damageTot to 0
- repeat with x = WeightSpr to itemSpr4
- puppetSprite(x, 1)
- end repeat
- me(launchItem1)
- set the perFrameHook to me
- put mastercntr into field "timerFLD"
- put "$" & damageTot into field "DmgFLD"
- go("game")
-
- method matframe
- if mastercntr < 1 then
- me(timesup)
- exit
- end if
- set mastercntr to mastercntr - 1
- if tempcntr > (mastercntr + 10) then
- put mastercntr into field "timerFLD"
- set tempcntr to mastercntr
- end if
- me(mPerform, weightDo)
- me(mPerform, ItemDo1)
- me(mPerform, ItemDo2)
- me(mPerform, itemdo3)
-
- method timesup n
- set the perFrameHook to 0
- repeat with x = 1 to 48
- puppetSprite(x, 0)
- end repeat
- puppetSprite(WtBtnSpr, 0)
- puppetSprite(BallBtnSpr, 0)
- puppetSound(0)
- if n = "LeaveGame" then
- go("1")
- else
- set reportTx to "Game Over!" & RETURN & "You smashed "
- put SmashTot & " items, worth a total of $" after reportTx
- put damageTot & "." & RETURN after reportTx
- put me(Eval) after reportTx
- put reportTx into field "reportFLD"
- go("gameover." & stars)
- end if
-
- method Eval
- global UCash
- if voidp(UCash) then
- set UCash to 0
- end if
- if damageTot < 40000 then
- set tx to "You are the worst smasher in the world."
- set stars to 0
- else
- if damageTot < 90000 then
- set tx to "You are a pitiful excuse for a smasher."
- set stars to 1
- else
- if damageTot < 140000 then
- set tx to "You suck at this."
- set stars to 2
- else
- if damageTot < 200000 then
- set tx to "You still suck at this."
- set stars to 3
- else
- if damageTot < 300000 then
- set tx to "You might be getting better... I wouldn't bet on it."
- set stars to 4
- else
- if damageTot < 500000 then
- set tx to "Hmm... not bad. You might become a smasher after all."
- set stars to 5
- else
- if damageTot < 700000 then
- set tx to "Pretty good... You're getting better."
- set stars to 6
- else
- if damageTot < 1000000 then
- set tx to "Wow! You did some heavy damage, but you're still NOT THE BEST."
- set stars to 7
- set UCash to UCash + 10000
- else
- if damageTot < 1500000 then
- set tx to "You really smashed things up. Damn good. But you are still not a true smasher."
- set stars to 8
- else
- set tx to "YOU ARE THE GREATEST SMASHER OF ALL TIME!"
- set stars to 10
- set UCash to UCash + 50000
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- return tx
-
- method DrawLocH spr, h
- set the locH of sprite spr to h
-
- method DrawLoc spr, h, v
- set the locH of sprite spr to h
- set the locV of sprite spr to v
-
- method DropWeight
- if weightDo = "nuttin" then
- puppetSprite(WtBtnSpr, 1)
- set the foreColor of sprite WtBtnSpr to 253
- set weightDo to "WtDropCyc"
- set wtcntr to 2
- set WeightArt to WtDropArt2
- set the castNum of sprite WeightSpr to WeightArt
- end if
-
- method WtDropCyc
- if wtcntr = 9 then
- set weightDo to "WtBounceA"
- set WeightArt to WtDropArt9
- exit
- end if
- set WeightArt to WeightArt + 1
- set the castNum of sprite WeightSpr to WeightArt
- set wtcntr to wtcntr + 1
-
- method smashsnd itemsnd
- set sndd to "wate" & itemsnd
- puppetSound(sndd)
-
- method smashsnd2 itemsnd
- set sndd to "wate" & itemsnd
- puppetSound(sndd)
-
- method WtBounceA
- set the locV of sprite WeightSpr to WeightV - 15
- set weightDo to "WtBounceB"
- if sprite WeightSpr intersects ItemSpr3 then
- me(smashsnd, ItemSnd3)
- set droppd to 1
- me(itemhit3)
- else
- if sprite WeightSpr intersects ItemSpr1 then
- set ItemDo1 to "BreakA1"
- me(smashsnd, ItemSnd1)
- else
- if sprite WeightSpr intersects itemspr2 then
- set ItemDo2 to "BreakA2"
- me(smashsnd, ItemSnd2)
- else
- puppetSound("WateHit.1")
- end if
- end if
- end if
-
- method WtBounceB
- set the locV of sprite WeightSpr to WeightV - 7
- set weightDo to "WtBounceC"
-
- method WtBounceC
- set the locV of sprite WeightSpr to WeightV
- set weightDo to "WtMovRite"
-
- method WtMovRite
- set wtcntr to wtcntr + 1
- set WeightH to WeightH + PixMovH
- set the locH of sprite WeightSpr to WeightH
- if wtcntr > 50 then
- set the foreColor of sprite WtBtnSpr to 117
- puppetSprite(WtBtnSpr, 0)
- set WeightH to WtHRest
- set WeightV to WtVRest
- me(DrawLoc, WeightSpr, WtHRest, WtVRest)
- set the castNum of sprite WeightSpr to WtDropArt1
- set weightDo to "nuttin"
- set wtcntr to 0
- end if
-
- method WeightTrap
- nothing()
-
- method dropball
- if BallDo = "nuttin" then
- puppetSprite(BallBtnSpr, 1)
- set the foreColor of sprite BallBtnSpr to 252
- go("balldrop")
- end if
-
- method ballhit
- if sprite ballSpr intersects ItemSpr3 then
- me(smashsnd2, ItemSnd3)
- set droppd to 2
- me(itemhit3)
- else
- if sprite ballSpr intersects ItemSpr1 then
- set ItemDo1 to "BreakA1"
- me(smashsnd2, ItemSnd1)
- else
- if sprite ballSpr intersects itemspr2 then
- set ItemDo2 to "BreakA2"
- me(smashsnd2, ItemSnd2)
- else
- puppetSound("BallHit.1")
- end if
- end if
- end if
-
- method itemhit3
- if itemdo3 starts "handgrab" then
- nothing()
- else
- set itemdo3 to BreakDo3
- end if
-
- method BallGo
- set the foreColor of sprite BallBtnSpr to 117
- puppetSprite(BallBtnSpr, 0)
- go("game")
-
- method launchXtra
- if itemdo3 <> "nuttin" then
- exit
- else
- set n to random(10)
- end if
- if n < 5 then
- me(launchClok)
- else
- if n < 9 then
- me(launchhand)
- end if
- end if
-
- method launchhand
- set BreakDo3 to "HandGrabA"
- set ItemSnd3 to "HandHit.1"
- set itemCntr3 to 0
- set itemArt3 to HandArt1
- set the castNum of sprite ItemSpr3 to itemArt3
- set ItemH3 to LaunchH1
- set ItemV3 to LaunchV1
- me(DrawLoc, ItemSpr3, ItemH3, ItemV3)
- set itemdo3 to "MovHandLeftA"
-
- method MovHandLeftA
- set ItemH3 to ItemH3 - PixMovH
- me(DrawLocH, ItemSpr3, ItemH3)
- set itemCntr3 to itemCntr3 + 1
- set the castNum of sprite ItemSpr3 to itemArt3 + (random(4) - 1)
- if itemCntr3 > (40 + random(4)) then
- set itemdo3 to "MovHandRiteA"
- set ItemH3 to LaunchH2
- set ItemV3 to LaunchV2
- me(DrawLoc, ItemSpr3, ItemH3, ItemV3)
- end if
-
- method MovHandRiteA
- set the castNum of sprite ItemSpr3 to itemArt3 + (random(4) - 1)
- set ItemH3 to ItemH3 + PixMovH
- me(DrawLocH, ItemSpr3, ItemH3)
- set itemCntr3 to itemCntr3 + 1
- if itemCntr3 > 80 then
- set itemCntr3 to 0
- set itemdo3 to "nuttin"
- end if
-
- method HandGrabA
- set artt to HandArt5 + droppd
- set itemCntr3 to 0
- set the castNum of sprite ItemSpr3 to artt
- set ItemH3 to ItemH3 - PixMovH
- me(DrawLocH, ItemSpr3, ItemH3)
- set itemdo3 to "HandGrabB"
- if droppd = 1 then
- set weightDo to "WeightTrap"
- set the locH of sprite WeightSpr to -100
- puppetSprite(WtBtnSpr, 1)
- set the foreColor of sprite WtBtnSpr to 220
- else
- puppetSprite(BallBtnSpr, 1)
- set the foreColor of sprite BallBtnSpr to 220
- puppetSprite(ballSpr, 1)
- set the locH of sprite ballSpr to -1000
- set BallDo to "BallTrap"
- end if
-
- method HandGrabB
- set itemCntr3 to itemCntr3 + 1
- set ItemH3 to ItemH3 - (PixMovH + itemCntr3)
- me(DrawLoc, ItemSpr3, ItemH3, ItemV3)
- if itemCntr3 > 12 then
- set itemdo3 to "HandGrabC"
- set itemCntr3 to 0
- end if
-
- method HandGrabC
- set itemCntr3 to itemCntr3 + 1
- if itemCntr3 > (100 + random(40)) then
- puppetSound("aahh.2")
- set itemdo3 to "nuttin"
- if weightDo = "weighttrap" then
- set the foreColor of sprite WtBtnSpr to 117
- set the castNum of sprite WeightSpr to WtDropArt1
- set weightDo to "nuttin"
- set WeightH to WtHRest
- set WeightV to WtVRest
- me(DrawLoc, WeightSpr, WtHRest, WtVRest)
- puppetSprite(WtBtnSpr, 0)
- else
- if BallDo = "BallTrap" then
- set the foreColor of sprite BallBtnSpr to 117
- set BallDo to "nuttin"
- puppetSprite(ballSpr, 0)
- puppetSprite(BallBtnSpr, 0)
- set itemCntr3 to 0
- end if
- end if
- end if
-
- method launchClok
- set BreakDo3 to "BreakClokA"
- set ItemSnd3 to "Hit.5"
- set itemCntr3 to 0
- set clokCntr to 0
- set itemArt3 to ClokArt1
- set the castNum of sprite ItemSpr3 to itemArt3
- set ItemH3 to LaunchH1
- set ItemV3 to LaunchV1
- set itemdo3 to "MovClokLeft"
- me(DrawLoc, ItemSpr3, ItemH3, ItemV3)
-
- method MovClokLeft
- if clokCntr < 14 then
- set clokCntr to clokCntr + 1
- else
- set clokCntr to 0
- end if
- set itemArt3 to ClokArt1 + clokCntr
- set the castNum of sprite ItemSpr3 to itemArt3
- set ItemH3 to ItemH3 - PixMovH
- me(DrawLocH, ItemSpr3, ItemH3)
- set itemCntr3 to itemCntr3 + 1
- if itemCntr3 > (40 + random(4)) then
- set itemdo3 to "MovClokRite"
- set ItemH3 to LaunchH2
- set ItemV3 to LaunchV2
- me(DrawLoc, ItemSpr3, ItemH3, ItemV3)
- end if
-
- method MovClokRite
- if clokCntr < 14 then
- set clokCntr to clokCntr + 1
- else
- set clokCntr to 0
- end if
- set itemArt3 to ClokArt1 + clokCntr
- set the castNum of sprite ItemSpr3 to itemArt3
- set ItemH3 to ItemH3 + PixMovH + random(4)
- me(DrawLocH, ItemSpr3, ItemH3)
- set itemCntr3 to itemCntr3 + 1
- if itemCntr3 > 80 then
- set itemCntr3 to 0
- set itemdo3 to "nuttin"
- set clokCntr to 0
- end if
-
- method BreakClokA droppd
- set mastercntr to mastercntr + 100 + random(50)
- set itemCntr3 to 0
- set itemArt3 to clokArtSmsh
- set the castNum of sprite ItemSpr3 to itemArt3
- set ItemH3 to ItemH3 - PixMovH
- set ItemV3 to ItemV3 + PixMovV
- me(DrawLoc, ItemSpr3, ItemH3, ItemV3)
- set itemdo3 to "BreakClokB"
-
- method BreakClokB
- set itemCntr3 to itemCntr3 + 1
- set ItemH3 to ItemH3 - (PixMovH + 2)
- set ItemV3 to ItemV3 + PixMovV
- me(DrawLoc, ItemSpr3, ItemH3, ItemV3)
- set itemdo3 to "BreakClokC"
-
- method BreakClokC
- set itemCntr3 to itemCntr3 + 1
- set ItemH3 to ItemH3 - (PixMovH + 4)
- set ItemV3 to ItemV3 + PixMovV
- me(DrawLoc, ItemSpr3, ItemH3, ItemV3)
- if itemCntr3 > 5 then
- set itemdo3 to "nuttin"
- set itemCntr3 to 0
- end if
-
- method makeItem1
- set n to random(60)
- if n < 5 then
- set itemart1 to DogArt1
- set ItemSnd1 to "Hit.2"
- set itemValue1 to 2
- else
- if n < 10 then
- set itemart1 to WineArt1
- set ItemSnd1 to "Hit.3"
- set itemValue1 to 7000 + random(1000)
- else
- if n < 15 then
- set itemart1 to VaseArt1
- set ItemSnd1 to "Hit.4"
- set itemValue1 to 12000 + random(2000)
- else
- set itemart1 to bowlart1
- set ItemSnd1 to "Hit.4"
- set itemValue1 to 25000 + random(3000)
- end if
- end if
- end if
-
- method launchItem1
- me(makeItem1)
- set the castNum of sprite ItemSpr1 to itemart1
- set ItemH1 to LaunchH1
- set ItemV1 to LaunchV1
- set ItemDo1 to "MovLeftA1"
- set itemCntr1 to 0
- me(DrawLoc, ItemSpr1, ItemH1, ItemV1)
-
- method MovLeftA1
- set ItemH1 to ItemH1 - PixMovH
- me(DrawLocH, ItemSpr1, ItemH1)
- set itemCntr1 to itemCntr1 + 1
- set ItemDo1 to "MovLeftB1"
-
- method MovLeftB1
- set ItemH1 to ItemH1 - PixMovH
- me(DrawLocH, ItemSpr1, ItemH1)
- set itemCntr1 to itemCntr1 + 1
- set ItemDo1 to "MovLeftC1"
-
- method MovLeftC1
- set ItemH1 to ItemH1 - PixMovH
- me(DrawLocH, ItemSpr1, ItemH1)
- set itemCntr1 to itemCntr1 + 1
- set ItemDo1 to "MovLeftD1"
- if itemart1 = bowlart1 then
- me(launchXtra)
- end if
-
- method MovLeftD1
- set ItemH1 to ItemH1 - PixMovH
- me(DrawLocH, ItemSpr1, ItemH1)
- set itemCntr1 to itemCntr1 + 1
- if itemCntr1 > (40 + random(3)) then
- set itemart1 to itemart1 + 1
- set the castNum of sprite ItemSpr1 to itemart1
- set ItemDo1 to "MovRite1"
- set ItemH1 to LaunchH2
- set ItemV1 to LaunchV2
- me(DrawLoc, ItemSpr1, ItemH1, ItemV1)
- me(launchItem2)
- end if
-
- method MovRite1
- set ItemH1 to ItemH1 + PixMovH
- me(DrawLocH, ItemSpr1, ItemH1)
- set itemCntr1 to itemCntr1 + 1
- if itemCntr1 > (84 + random(2)) then
- set itemCntr1 to 0
- me(launchItem1)
- end if
-
- method BreakA1
- me(award, itemValue1)
- set itemart1 to itemart1 + 1
- set the castNum of sprite ItemSpr1 to itemart1
- set ItemH1 to ItemH1 + PixMovH
- me(DrawLocH, ItemSpr1, ItemH1)
- set ItemDo1 to "BreakB1"
-
- method BreakB1
- set ItemH1 to ItemH1 + PixMovH
- me(DrawLocH, ItemSpr1, ItemH1)
- set itemCntr1 to itemCntr1 + 1
- set ItemDo1 to "BreakC1"
-
- method BreakC1
- set itemart1 to itemart1 + 1
- set the castNum of sprite ItemSpr1 to itemart1
- set ItemH1 to ItemH1 + PixMovH
- me(DrawLocH, ItemSpr1, ItemH1)
- set itemCntr1 to itemCntr1 + 1
- set ItemDo1 to "MovRite1"
-
- method makeItem2
- set n to random(60)
- if n < 24 then
- set itemArt2 to DogArt1
- set ItemSnd2 to "Hit.2"
- set itemValue2 to 2
- else
- if n < 40 then
- set itemArt2 to WineArt1
- set ItemSnd2 to "Hit.3"
- set itemValue2 to 7000 + random(1000)
- else
- if n < 53 then
- set itemArt2 to VaseArt1
- set ItemSnd2 to "Hit.4"
- set itemValue2 to 10000 + random(2200)
- else
- set itemArt2 to bowlart1
- set ItemSnd2 to "Hit.4"
- set itemValue2 to 24000 + random(4000)
- end if
- end if
- end if
-
- method launchItem2
- me(makeItem2)
- set the castNum of sprite itemspr2 to itemArt2
- set ItemH2 to LaunchH1
- set ItemV2 to LaunchV1
- set ItemDo2 to "MovLeft2"
- set itemCntr2 to 0
- me(DrawLoc, itemspr2, ItemH2, ItemV2)
-
- method MovLeft2
- set ItemH2 to ItemH2 - PixMovH
- me(DrawLocH, itemspr2, ItemH2)
- set itemCntr2 to itemCntr2 + 1
- if itemCntr2 > (40 + random(3)) then
- set itemArt2 to itemArt2 + 1
- set the castNum of sprite itemspr2 to itemArt2
- set ItemDo2 to "MovRite2"
- set ItemH2 to LaunchH2
- set ItemV2 to LaunchV2
- me(DrawLoc, itemspr2, ItemH2, ItemV2)
- end if
-
- method MovRite2
- if itemCntr2 > 84 then
- nothing()
- exit
- end if
- set ItemH2 to ItemH2 + PixMovH
- me(DrawLocH, itemspr2, ItemH2)
- set itemCntr2 to itemCntr2 + 1
-
- method BreakA2
- me(award, itemValue2)
- set itemArt2 to itemArt2 + 1
- set the castNum of sprite itemspr2 to itemArt2
- set ItemH2 to ItemH2 + PixMovH
- me(DrawLocH, itemspr2, ItemH2)
- set ItemDo2 to "BreakB2"
-
- method BreakB2
- set ItemH2 to ItemH2 + PixMovH
- me(DrawLocH, itemspr2, ItemH2)
- set itemCntr2 to itemCntr1 + 2
- set ItemDo2 to "BreakC2"
-
- method BreakC2
- set itemArt2 to itemArt2 + 1
- set the castNum of sprite itemspr2 to itemArt2
- set ItemH2 to ItemH2 + PixMovH
- me(DrawLocH, itemspr2, ItemH2)
- set itemCntr2 to itemCntr2 + 1
- set ItemDo2 to "MovRite2"
-